package com.cn.service;

import java.util.List;

import com.cn.entity.Stock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cn.dao.StockMapper;

@Service
public class StockService {
	@Autowired
	private StockMapper stockMapper;

	public StockMapper getStockMapper() {
		return stockMapper;
	}

	public void setStockMapper(StockMapper stockMapper) {
		this.stockMapper = stockMapper;
	}

	public void sellStock(int stockId) {
		// TODO Auto-generated method stub
		stockMapper.sellStockByStockId(stockId);

	}

	public List<Stock> selectStocksByKey(String key) {
		// TODO Auto-generated method stub
		return stockMapper.selectStocksByKey(key);
	}

	public Stock lookStockByStockId(int stockId) {
		// TODO Auto-generated method stub
		return stockMapper.lookStockByStockId(stockId);

	}



}
